﻿@model Biblioteca.Models.Cuenta

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Cuenta</legend>
        <select name="User">
            @foreach (var s in (List<Biblioteca.Models.Usuario>) ViewData["Users"])
           {
                <option value="@s.IdUsuario">@s.Nombre @s.Apellido</option>
               <p> @s.Apellido </p>
           }
                <option value="-1" selected="selected">--Seleccion el usuario--</option>
        </select>
           
            
        <div class="editor-label">
            @Html.LabelFor(model => model.Usuario)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Usuario)
            @Html.ValidationMessageFor(model => model.Usuario)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Password)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
